package cn.ingrun.ingrunutils.params;

public class RequestParams<T> {

    private Integer page;
    private Integer pageSize;
    private String sort;
    private T model;

    public void setPage(Integer page) {
        this.page = page;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public int getPage () {
        return page;
    }

    public void setPage (int page) {
        this.page = page;
    }

    public int getPageSize () {
        return pageSize;
    }

    public void setPageSize (int pageSize) {
        this.pageSize = pageSize;
    }

    public String getSort () {
        return sort;
    }

    public void setSort (String sort) {
        this.sort = sort;
    }

    public PageParams getPageParams () {
        if ( this.pageSize != null && this.page != null ) {
            return new PageParams(this.page, this.pageSize, this.sort);
        }
        return null;
    }

    public T getModel() {
        return model;
    }

    public void setModel(T model) {
        this.model = model;
    }
}
